package com.css.bjdt_core.reportExplainFill.service;

import org.nutz.dao.Dao;
import org.nutz.dao.Sqls;
import org.nutz.dao.sql.Sql;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.css.bjdt_core.util.ReportConstant;

@Service
public class RptExplainCellTextFillService {

	@Autowired
	private Dao dao;

	public String getExplainCellTextValue(String annualId, String explainValueId) {
		//取到真正的
		String tableNameText = ReportConstant.EXPLAIN_TEXT_TABLE_PREFIX + annualId;
		String strSqlText = ReportConstant.EXPLAIN_TEXT_QUERY_SQL.replace("$table_name", tableNameText);
		Sql sqlText = Sqls.create(strSqlText);
		sqlText.setCallback(Sqls.callback.str());
		sqlText.params().set("explainTextId", explainValueId);
		dao.execute(sqlText);
		String explainCellText = sqlText.getObject(String.class);
		return explainCellText;
	}
}
